package FirstLabPractice;

public class Queue {
	public int num;
	public Queue next;
	public static Queue head = null;
	public static Queue tail = null;
	
	Queue() {
		next = null;
	}
	
	void addEl(int k)
	{
		String s;
		s = "Add:"+k;
		System.out.println(s);
		Queue newEl = new Queue();
		newEl.num = k;
		if (head == null)
		{
			head = newEl;
			tail = newEl;
		}
		else
		{
			tail.next = newEl;
			tail = newEl;
		}
	}
	int popEl()
	{
		String s;
		int k = head.num;
		s = "Pop:"+k;
		System.out.println(s);
		Queue temp = null;
		temp = head;
		head = head.next;
		temp.next = null;
		temp = null;
		return 0;
	}
	
}
